package com.hjw.java.abstract_demo1;

/**
 * 大众卡，打9折
 * @author hjwStrart
 * @create 2022-01-13 11:07
 */
public class VolkswagenCard extends Card{

    {
        setDiscount(0.90);
    }

    public VolkswagenCard(String noCard, String password, String user, Double balance) {
        super(noCard, password, user, balance);
    }

    @Override
    public Boolean pay(Double paymentAmount) {
        if (getBalance() < paymentAmount * 0.9 || paymentAmount < 0){
            return false;
        }else{
            setBalance( getBalance() - paymentAmount * 0.9 );
            return true;
        }
    }
}
